<template>
  <div class="content">
    <div v-if="blogDataInfo.list && blogDataInfo.list.length > 0">
      <div v-for="(item, index) in blogDataInfo.list" :key="index">
        <blog-card :cardObj="item" v-motion-slide-left></blog-card>
      </div>
    </div>
    <div class="l-empty" v-else>
      <a-empty description="没有数据" />
    </div>
  </div>
</template>

<script setup>
import { ref, getCurrentInstance } from 'vue'
import BlogCard from '@/components/blog-card.vue';
const { proxy } = getCurrentInstance();
const api = {
  loadBlogList: "/view/loadBlogList"
};
const blogDataInfo = ref({});
const loadBlogList = async (pageNo) => {
  pageNo = pageNo == null ? 1 : pageNo;
  let result = await proxy._request({
    url: api.loadBlogList,
    params: {
      pageSize: 200,
      pageNo: 1
    },
  });
  if (!result) {
    return;
  }
  blogDataInfo.value = result.data;
};
loadBlogList();
</script>

<style lang="scss" scoped>
.content {
  flex: 1;
  padding: 20px;
  box-sizing: border-box;
}
</style>